package czh.cocoa.ui;

import czh.cocoa.foundation.NSObject;
import czh.cocoa.graphics.CGColor;

public class UIColor extends NSObject {

	private CGColor mColor;
	
	public UIColor(CGColor color) {
		mColor = color;
	}
	
	public UIColor(UIColor color) {
		mColor = new CGColor(color.CGColor());
	}
	
	public UIColor(float red, float green, float blue, float alpha) {
		mColor = new CGColor(new float[]{red,green,blue,alpha});
	}
	
	public UIColor(UIImage pattern) {
		mColor = new CGColor(pattern.CGImage()); 
	}
	
	public CGColor CGColor() {
		return mColor;
	}
	
	public UIColor colorWithAlphaComponent(float alpha) {
		return new UIColor(mColor.red, mColor.green, mColor.blue, alpha); 
	}
	
	public static UIColor colorWithWhiteAlpha(float white, float alpha) {
		return new UIColor(white, white, white, alpha);
	}
	
	public static UIColor blackColor() {
		return new UIColor(0, 0, 0, 1);
	}
	
	public static UIColor whiteColor() {
		return new UIColor(1, 1, 1, 1);
	}
	
	public static UIColor redColor() {
		return new UIColor(1, 0, 0, 1);
	}
	
	public static UIColor greenColor() {
		return new UIColor(0, 1, 0, 1);
	}
	
	public static UIColor blueColor() {
		return new UIColor(0, 0, 1, 1);
	}
	
	public static UIColor grayColor() {
		return new UIColor(0.5f, 0.5f, 0.5f, 1);
	}
	
	public static UIColor darkGrayColor() {
		return new UIColor(0.33f, 0.33f, 0.33f, 1);
	}
	
	public static UIColor yellowColor() {
		return new UIColor(1, 1, 0, 1);
	}
	
	public static UIColor clearColor() {
		return new UIColor(0, 0, 0, 0);
	}
	
	public static UIColor brownColor() {
		return new UIColor(0.6f, 0.4f, 0.2f, 1);  
	}
	
	public static UIColor orangeColor() {
		return new UIColor(1, 0.5f, 0, 1);  
	}
	
	public static UIColor cyanColor() {
		return new UIColor(0, 1, 1, 1);  
	}
	
}







